package de.tum.in.eist.poll.shared.beans;

import java.io.Serializable;

/**
 * SingleChoiceAnswer is an Answer which carries a choice.
 * SingleChoiceAnswer corresponds to {@link SingleChoiceQuestion}
 * 
 * @author The EIST-POLL-21 team.
 *
 */
public final class SingleChoiceAnswer extends Answer implements Serializable {
	
	/**
	 * serialization version  
	 */
	private static final long serialVersionUID = 1L;
	
	private int choice;
	
	/**
	 * Dummy constructor for GWT. Never ever use this.
	 */
	public SingleChoiceAnswer() {
		choice = -1;
	}
	
	/**
	 * Construct a SingleChoiceAnswer given a choice. The choice must be an
	 * index corresponding to the list of choices given by the question.
	 * The choice may be -1 to indicate that no choice has been made.
	 * 
	 * @param choice The choice
	 */
	public SingleChoiceAnswer(int choice) {
		this.choice = choice;
	}

	/**
	 * @return The choice which has been made
	 */
	public int getChoice() {
		return this.choice;
	}
}
